/*
 * queue.c
 *
 *  Created on: 10/05/2010
 *      Author: Neo
 */

#include <includes.h>


INT8U queue[5];

INT8U count=0;
INT8U front=0;
INT8U rear=0;

void put(int x)
  {
    queue[rear] = x;
    rear = (rear + 1) % 5;
    count++;
  }

int take()
  {
    int num = queue[front];
    queue[front] = 0;
    front = (front + 1) % 5;
    count--;
    return num;
  }
